<?php
/**
 * Plugin: ACL
 * Retrieves the ACL class for the user
 */
class Bliss_User_Plugin_Acl extends Bliss_User_Plugin_Abstract
{
	protected $_acl;
	
	protected function init()
	{
		$this->_acl	= Bliss_User::getInstance()->getAcl();
	}

	public function acl($returnAcl=false)
	{
		return ($returnAcl) ? $this->_acl : $this;
	}

	public function isAllowed($resource, $permission)
	{
		$user	= Bliss_User::getInstance();
		if(!$user->hasIdentity()) return false;
		
		return $this->_acl->isAllowed($this->_user->group, $resource, $permission);
	}
}
?>